package com.oalam.bookstore.domain.books;


import com.oalam.bookstore.domain.BusinessObject;
import com.oalam.bookstore.domain.shopping.AbstractPrice;
import java.io.Serializable;

/**
 * @author Administrateur
 * @version 1.0
 * @created 28-juil.-2011 16:18:24
 */
public class Book implements Serializable, BusinessObject {

    private Author author;
    public Publisher m_Publisher;
    public Review m_Review;
    private AbstractPrice price;
    private String title;
    private String isbn;

    public Book(String isbn) {
        this.isbn = isbn;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Book other = (Book) obj;
        if (this.author != other.author && (this.author == null || !this.author.equals(other.author))) {
            return false;
        }
        if (this.m_Publisher != other.m_Publisher && (this.m_Publisher == null || !this.m_Publisher.equals(other.m_Publisher))) {
            return false;
        }
        if (this.m_Review != other.m_Review && (this.m_Review == null || !this.m_Review.equals(other.m_Review))) {
            return false;
        }
        if (this.price != other.price && (this.price == null || !this.price.equals(other.price))) {
            return false;
        }
        if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
            return false;
        }
        if ((this.isbn == null) ? (other.isbn != null) : !this.isbn.equals(other.isbn)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }



    @Override
    public <T extends BusinessObject> void clone(T t) {
        Book b = (Book) t;
        this.title = b.title;
        this.isbn = b.isbn;
    }

    @Override
    public String getId() {
        return isbn;
    }

    public AbstractPrice getPrice() {
        return price;
    }

    public void setPrice(AbstractPrice price) {
        this.price = price;
    }

    public Author getAuthor() {
        return author;
    }

    public void setAuthor(Author author) {
        this.author = author;
    }
    
    
}